<h3>Folio Salida: <%= @salida_almacen.id %></h3>

<div class="tablas-info">
    <div class="tabla-titulo">
        <h2>Seleccione los productos a los que dara<strong> Salida</strong></h2>
    </div>

    <div id="tabla-data" class="in">
        <div class="table-responsive">
            <table id="tbl_det_salida" class="table table-striped table-hover table-datos">
                <thead>
                    <tr>
                        <th>Partida</th>
                        <th>No de Parte</th>
                        <th>Descripcion</th>
                        <th>Lote</th>
                        <!--th>Inv. Inicial</th!-->
                        <th>Saldo en Bodega</th>
                        <th>Peso</th>
                    </tr>
                </thead>
  
                <tbody>
                  <% @receiving_ticket.rt_detalles.each do |detalle| %>
                  <% unless detalle.cantidad == 0 %>
                    <tr id="<%= detalle.id %>">
                      <td><%= detalle.id %></td>
                      <td><%= detalle.partida %></td>
                      <td><%= detalle.descripcion %></td>
                      <td><%= detalle.lote %></td>
                      <!--td><!--%= detalle.cant_inicial %></td-->
                      <td><%= detalle.cantidad %></td>
                      <td><%= detalle.kilos %> Kg - <%= detalle.libras %> Lb</td> 
                    </tr> 
                  <% end %>
                  <% end %>
                </tbody>           
            </table> 
        </div>
    </div>
</div>
.
<!-- ---------------------------Formulario del detalle de la salida------------ --> 
<%= form_tag(guardar_salida_items_path(@salida_almacen.id)) do %>
    <div class="formulario">
        <div class="in form-body form-partida" id="form-data">
            
         <%= fields_for :detalles_rt_salida do |d| %>
          <%= d.hidden_field :rt_detalle_id %>
            <div class="row">
               <div class="col-sm-3">
                 <div class="form-group campo-data">
                  <%= d.label :salida_almacen_id, "Salida No" %><br>
                  <%= d.text_field :salida_almacen_id,:value => @salida_almacen.id,:readonly => true ,:class => "form-control" %>
                    </div>
               </div>
              
               <div class="col-sm-3">
                 <div class="form-group campo-data">
                    <%= label_tag :receiving_ticket_id, "Rt Afectado" %><br>
                    <%= text_field_tag :receiving_ticket, :id,:value => @receiving_ticket.id,:readonly => true ,:class => "form-control" %>
                  </div>
               </div> 
                <div class="col-sm-5">
                 <div class="form-group campo-data">
                    <%= d.label :no_parte, "No de Parte" %><br>
                    <%= d.text_field :no_parte ,:class => "form-control" %>
                  </div>
               </div>
            </div>
          <div class="row">      
               <div class="col-sm-11">
                 <div class="form-group campo-data">
                  <%= d.label :descripcion %><br>
                  <%= d.text_area :descripcion ,:class => "form-control" %>
                </div>
               </div>
          </div>
          <div class ="row">
               <div class="col-sm-2">
                 <div class="form-group campo-data">
                  <%= d.label :cantidad %><br>
                  <%= d.text_field :cantidad ,:class => "form-control" %>
                </div>
               </div>
              
               <div class="col-sm-2">
                 <div class="form-group campo-data">
                  <%= d.label :peso %><br>
                  <%= d.text_field :peso ,:class => "form-control" %>
                </div>
               </div>
            
               <div class="col-sm-2">
                 <div class="form-group campo-data">
                  <%= d.label :pallets %><br>
                  <%= d.text_field :pallets ,:class => "form-control" %>
                </div>
               </div>

               <div class="col-sm-5">
                 <div class="form-group campo-data">
                  <%= d.label :pedimento %><br>
                  <%= d.text_field :pedimento ,:class => "form-control" %>
                </div>
               </div>    
            </div>
          
            <div class="row">
                  <div class="col-sm-11">
                   <div class="form-group campo-data">
                    <%= d.label :comentarios %><br>
                    <%= d.text_area :comentarios ,:class => "form-control" %>
                  </div>
                 </div>
            </div>
              <% end %>

          </div>
      
      </div>
  
  <div class="formulario-footer">
       <%= submit_tag "Agregar", :class => "btn btn-primary" %>
   </div>
<% end %>
<!-- ----------------------------- End formulario-------------------------- -->

<%= render 'productos_salida' %>
